<template>
    <div>
        <el-menu :default-active="$route.path" @select="handleSelect">
            <el-submenu index="1">
                <template v-slot:title><i class="el-icon-message"></i>缴费</template>
                <el-menu-item-group>
                    <el-menu-item v-if="userrole === 'student'" index="/payment1">网上缴费</el-menu-item>
                    <el-menu-item v-if="userrole === 'office'" index="/payment2">现场缴费</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
            <el-submenu v-if="userrole === 'office'" index="2">
                <template v-slot:title><i class="el-icon-menu"></i>统计</template>
                <el-menu-item-group>

                    <el-menu-item index="/index2">在校生报道系主页面</el-menu-item>
                    <el-menu-item index="/onlineFee">网上缴费统计</el-menu-item>
                    <el-menu-item index="/offlineFee">现场缴费统计</el-menu-item>
                    <el-menu-item index="/totalFee">综合缴费统计</el-menu-item>
                    <el-menu-item index="/gChannel">绿色通道办理统计</el-menu-item>
                    <el-menu-item index="/advent">报到统计</el-menu-item>
                </el-menu-item-group>
            </el-submenu>
        </el-menu>
    </div>
</template>

<script>
import userManager from "@/UserManager";

export default {
    data(){
        return {
            userrole:userManager.getPermissions()
        };

    },

    methods: {
        handleSelect(key, keyPath) {
            this.$router.push(key);
        }
    }
}
</script>